/*
 * SurfaceFactory.cpp
 *
 *  Created on: Nov 15, 2011
 *      Author: gonzalo
 */

#include "SurfaceFactory.h"

SurfaceFactory::SurfaceFactory(SDLEngine* engine) {
	this->engine =engine;
}

SurfaceFactory::~SurfaceFactory() {
}

SDL_Surface* SurfaceFactory::getSurface(std::string path){
	return SDLEngine::loadSurface(path);
}

SDL_Surface* SurfaceFactory::getSurface(SurfaceType type){

	switch (type) {
		case SURFACEBUTTON_RELEASED:
			return SDLEngine::loadSurface("./res/img/button_default.png");
			break;

		case SURFACEBUTTON_PRESSED:
			return SDLEngine::loadSurface("./res/img/button_pressed.png");
			break;
		case SURFACEBUTTONSCROLLBARUP_PRESSED:
			return SDLEngine::loadSurface("./res/img/upbuttonsmall_pressed.png");
			break;

		case SURFACEBUTTONSCROLLBARUP_RELEASED:
			return SDLEngine::loadSurface("./res/img/upbuttonsmall_pressed.png");
			break;
		case SURFACEBUTTONSCROLLBARDOWN_PRESSED:
			return SDLEngine::loadSurface("./res/img/downbuttonsmall_pressed.png");
			break;

		case SURFACEBUTTONSCROLLBARDOWN_RELEASED:
			return SDLEngine::loadSurface("./res/img/downbuttonsmall_pressed.png");
			break;
		case SURFACEBULLET:
			return SDLEngine::loadSurface("./res/img/bullet.png");
			break;

		case SURFACETANK:
			return SDLEngine::loadSurface("./res/img/tanks.png");
			break;

		case SURFACETEXTBOX:
			return SDLEngine::loadSurface("./res/img/textbox.png");
			break;

		case SURFACETEXTBOXSCROLLBAR :
			return SDLEngine::loadSurface("./res/img/fondoScrollText.png");
			break;

		case SURFACETEXTBOXSCROLLBARELEMENT_RELEASED :
			return SDLEngine::loadSurface("./res/img/scrollbartext_default.png");
			break;
		case SURFACETEXTBOXSCROLLBARELEMENT_PRESSED:
			return SDLEngine::loadSurface("./res/img/scrollbartext_pressed.png");
			break;

		case SURFACEMESSAGELABEL_ON:
			return SDLEngine::loadSurface("./res/img/error_on.png");
			break;
		case SURFACEMESSAGELABEL_OFF:
			return SDLEngine::loadSurface("./res/img/error_off.png");
			break;
	}

	return NULL;
}
